#ifndef LARGEDISPLAYEVENT_H
#define LARGEDISPLAYEVENT_H

#pragma once

#include <LDF/LargeDisplayFrameworkLayer.h>
#include <LDF/Utils/Point3f.h>

class VisComponent;


/**
 * This class provides a base for events in the Large Display Framework. In
 * this base case, the only data available is the event type, the identifier
 * of the user who produced the event, and the coordinates of the event. If
 * more data is needed this class should be extended by the application.
 *
 * @author Fabricio Anastacio - fabriciocfa@yahoo.com
 * @since October 1, 2007
 */
class LARGEDISPLAYFRAMEWORKLAYER_API LargeDisplayEvent
{
	// Attributes
public:
	static const unsigned int NoUserId;
	
protected:
	/** The type identifier of this event. */
	unsigned int type;
	/** The identifier of the user that generated this event. */
	unsigned int userID;
	/** The reference to the component that generated this event (if not a user). */
	VisComponent* sender;
	/** The 3D coordinate of this event. */
	Point3f coords;
	/** Determines the state of the event. */
	unsigned int state;
	

	// Methods
public:
	/**
	 * Constructs an event object for the large display framework.
	 *
	 * @param typeId the identifier of the type of this event.
	 * @param userId the identifier of the user who produced this event.
	 * @param x the x-coordinate of this event.
	 * @param y the y-coordinate of this event.
	 * @param z the z-coordinate of this event.
	 */
	LargeDisplayEvent(unsigned int typeId = 0, unsigned int userId = LargeDisplayEvent::NoUserId,
		float x = 0, float y = 0, float z = 0,
		VisComponent* senderComponent = NULL, unsigned int evtState = 1);
	/**
	 * Destroys this event.
	 */
	virtual ~LargeDisplayEvent(void);


	// ACCESSOR METHODS
	/**
	 * Returns the type identifier of this event.
	 *
	 * @return the type identifier of this event.
	 */
	inline unsigned int getType() { return type; };
	/**
	 * Sets the type identifier of this event.
	 *
	 * @param t the type identifier of this event.
	 */
	inline void setType(unsigned int t) { type = t; };
	/**
	 * Returns the identifier of the user that generated this event.
	 *
	 * @return the identifier of the user that generated this event.
	 */
	inline unsigned int getUserID() { return userID; };
	/**
	 * Sets the identifier of the user that generated this event.
	 *
	 * @param user the identifier of the user that generated this event.
	 */
	inline void setUserID(unsigned int user) { userID = user; };
	/**
	 * Returns a reference to the component that generated this event (if not a
	 * user).
	 *
	 * @return a reference to the component that generated this event.
	 */
	inline VisComponent* getSender() { return sender; };
	/**
	 * Sets the component that is generating this event (if not a user).
	 *
	 * @param c the component that is generating this event.
	 */
	inline void setSender(VisComponent* c) { sender = c; };
	/**
	 * Returns the 3D coordinates of this event.
	 *
	 * @return the 3D coordinates of this event.
	 */
	inline Point3f getCoords() { return coords; };
	/**
	 * Sets the 3D coordinates of this event.
	 *
	 * @param p the 3D coordinates of this event.
	 */
	inline void setCoords(Point3f p) { coords = p; };
	/**
	 * Returns the x-coordinate of this event.
	 *
	 * @return the x-coordinate of this event.
	 */
	inline float getX() { return coords.x; };
	/**
	 * Sets the the x-coordinate of this event.
	 *
	 * @param value the x-coordinate of this event.
	 */
	inline void setX(float value) { coords.x = value; };
	/**
	 * Returns the y-coordinate of this event.
	 *
	 * @return the y-coordinate of this event.
	 */
	inline float getY() { return coords.y; };
	/**
	 * Sets the the y-coordinate of this event.
	 *
	 * @param value the y-coordinate of this event.
	 */
	inline void setY(float value) { coords.y = value; };
	/**
	 * Returns the z-coordinate of this event.
	 *
	 * @return the z-coordinate of this event.
	 */
	inline float getZ() { return coords.x; };
	/**
	 * Sets the the z-coordinate of this event.
	 *
	 * @param value the z-coordinate of this event.
	 */
	inline void setZ(float value) { coords.z = value; };
	/**
	 * Returns the state of this event.
	 *
	 * @return the state of this event.
	 */
	inline unsigned int getState() { return state; };
	/**
	 * Sets the the state of this event.
	 *
	 * @param value the state of this event.
	 */
	inline void setState(unsigned int value) { state = value; };


	// DEBUGGING
	/**
	 * Prints the contents of this event object for debugging purposes.
	 */
	void print();
};


#endif  // LARGEDISPLAYEVENT_H
